<head>
	<script>
		setTimeout(function() 
			{
				$('#flashMessage').fadeOut('slow');
			}, 5000);
	</script>

</head>
<body>
	<legend>Editar Usuario</legend>
		
	    <?php echo $this->Session->flash() ?>
		<a onclick="showConsult();" href="#">
		<img id="blah" src="/BackEndRecursosHumanos/app/webroot/img/button_back.png" alt="your image" width="30px" height="30px" />
		<br />	
		<lable>Regresar</label>
	</a>
	<br />
	<br />
	<center>
		<fieldset class="fieldset_modulo">
			<legend><b>Informacion Referente de la Cuenta</b></legend>
			<center>
				<table>
					<tr>
						<td>
							<center>
								<table >
									<tr>
										<td>
											<center>
											<?php 
													echo $this->Form->create('User',array(
																							'id' => 'id_cambio_username',
																							'onsubmit'=>'return confirm("Desea cambiar el nombre de usuario?");'
																						 )
																		    );
													echo $this->Form->input('id', array(
																							'type' => 'hidden',
																							'value' => $usuario[0]['U']['id'],
																							
																						)
																			);
													echo $this->Form->input('username',array(
																				'label' => array('text' => 'Nombre de Usuario',
																								 'style' => array(
																								 					
																								 				 )
																								),
																				'value' => $usuario[0]['U']['username'],
																				'style' => array(' text-align: center;')
																			  )
									  									  );
													echo $this->Form->input('id_accion',array(
																								'type' => 'hidden',
																								'value' => '1'
																								
																							)
																			);
													echo "<br />";
												  	echo $this->Form->button('Cambiar Nombre',array(
												  												'class' => 'boton_regular',
												  												'type' => 'button',
																								'onclick' => 'editUsuario(1)',
												  												'label' => array(
												  																	'display: none:'
																												)
												  											)
																			);
													echo $this->Form->end();
													echo "<br />";
												  ?>
												  
												  
											</center>		  	
										</td>
									</tr>
									<tr>
										<td style="text-align: center">
											
											<?php
													echo $this->Form->create('User',array(
																							'id' => 'id_cambio_password',
																							'onsubmit'=>'return confirm("Desea resetear la contraseña a una default?");'
																						 )
																			); 
													echo '<label>Reseteo de la Contraseña</label>';
													echo $this->Form->input('id', array(
																							'type' => 'hidden',
																							'value' => $usuario[0]['U']['id'],
																							
																						)
																			);
													echo $this->Form->input('password',array(
																								'type' => 'hidden',
																								'value' => 'Cambiar_Password'
																								
																							)
																			);
													echo $this->Form->input('id_accion',array(
																								'type' => 'hidden',
																								'value' => '2'
																								
																							)
																			);
												  	echo "<br />";
												  	echo $this->Form->button('Resetear',array(
												  												'class' => 'boton_regular',
												  												'type' => 'button',
																								'onclick' => 'editUsuario(2)',
												  												'label' => array(
												  																	'display: none:'
																												)
												  											)
																			);
													echo "<br />";
													echo $this->Form->end();
																				
															   
												  
											?>
										</td>
									</tr>
										
									<tr>
										<td>
											<center>
												<table>
													<tr>
														<td>
															<center>
															<?php
																			echo '<label> Status de la Cuenta</label>';
																			
																			if ($usuario[0]['U']['active_user'] == FALSE)
																			{
																				echo $this->Form->input('status_user', array(
																															'type' => 'hidden',
																															'value' => '1'
																													
																												)
																									);
																				echo $this->Html->image('power_off.png', array(
																																	'alt' => 'CakePHP',
																																	'onclick' => 'editUsuario(3)',
																																	'style' => array (
																																						'cursor: pointer'
																																					 )	
																											  					)
																									  );
																				echo '<b> Desactivada </b>';
																			}
																			else 
																			{
																				echo $this->Form->input('status_user', array(
																															'type' => 'hidden',
																															'value' => '2'
																													
																												)
																									);
																				echo $this->Html->image('power_on.png', array(
																																	'alt' => 'CakePHP',
																																	'onclick' => 'editUsuario(3)',
																																	'style' => array (
																																						'cursor: pointer'
																																					 )
																											  					)
																									  );
																				echo '<b> Activada </b>';
																				
																			}
																		 ?>
															</center>
														</td>
														
													</tr>
												</table>
											</center>
										</td>
									</tr>
								</table>
							</center>
						</td>
						
					</tr>
				</table>
			</center>
		</fieldset>
	</center>
</body>
